package com.demo.service.impl;

import com.demo.dao.StageDao;
import com.demo.dto.StageDto;
import com.demo.pojo.Stage;
import com.demo.service.StageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName StageServiceImpl
 * @Description TODO
 * @Author Windy
 * @Date 2022/9/7 19:42
 * @Version 1.0
 **/
@Service
public class StageServiceImpl  implements StageService {

    @Autowired
    StageDao stageDao;

    @Override
    public List<StageDto> findAllDto() {
        return stageDao.findAllDto();
    }

    @Override
    public StageDto findOneById(String id) {
        return stageDao.findOneById(id);
    }

    @Override
    public boolean updateStage(Stage stage) {
        return stageDao.updateStage(stage)>=0;
    }

    @Override
    public boolean deleteStageById(String sid) {
        return stageDao.deleteStageById(sid) > 0;
    }

    @Override
    public boolean insertStage(Stage stage) {
        return stageDao.insertStage(stage) >= 0;
    }
}
